<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>支付测试</title>
		<script type="text/javascript" src="../js/boot.js"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	</head>

	<body>
		<a href="javascript:pay();" target="_self">
			<h1>支付测试</h1></a>
	</body>

	<script type="text/javascript">
		function pay() {
			var openId = localStorage.getItem('openId');
			alert(openId);
			//订单
			var order = {
				openId: openId,
				orderFee: '0.01',
				body: "订单支付",
				ip: '0.0.0.0'
			};
			// alert(JSON.stringify(order));
			http.post("/wechat/createOrder.do", order, function(page) {
				if(page.success) {
					// var data = JSON.stringify(page.data);
					order.orderId = page.data.orderId;
					// alert(order.orderId);
					http.gotoHtml("/weixin/pay/pay.html", order);
				} else {
					alert(page.message);
				}
			});
		}

	</script>

</html>